package cn.itcast.controller

import cn.itcast.domain.MetaTable
import cn.itcast.service.MetaTableService
import cn.itcast.utils.ServerResponse
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation._

/**
  * create by zhangtian on 2019/1/11
  */
@RestController
@RequestMapping(value = Array("meta/table"))
class MetaTableController @Autowired()(metaTableService: MetaTableService) {

  @PostMapping
  def saveMetaTable(@ModelAttribute metaTable: MetaTable): ServerResponse[MetaTable] = {
    metaTableService.saveMetaTable(metaTable)
  }

  @GetMapping
  def findAllMetaTable = {
    metaTableService.findAllMetaTable()
  }
}
